
using StudentVideo.Shared.Enums;

namespace StudentVideo.Shared.Components.CuForm;

/// <summary>
/// CuForm 所需元数据
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CuFormMateAttribute: Attribute {
   /// <summary>
   /// 排序
   /// </summary>
   public int Order { get; set; } = 999;

   /// <summary>
   /// 表单类型
   /// </summary>
   public CuFormTypeEnums FormType { get; set; }

   /// <summary>
   /// 提示内容
   /// </summary>
   public string? Help { get; set; } = null;

   public string[]? Helps { get; set; }

   /// <summary>
   /// 默认为文本输入框
   /// </summary>
   public CuFormMateAttribute() {
      FormType = CuFormTypeEnums.Text;
   }

   public CuFormMateAttribute(string help) : this() {
      Help = help;
   }

   public CuFormMateAttribute(string help, int order) : this() {
      Help = help;
      Order = order;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums) {
      FormType = formTypeEnums;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums, int order) {
      FormType = formTypeEnums;
      Order = order;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums, string help) {
      FormType = formTypeEnums;
      Help = help;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums, string help, int order) {
      FormType = formTypeEnums;
      Help = help;
      Order = order;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums, string[] helps) {
      FormType = formTypeEnums;
      Helps = helps;
   }

   public CuFormMateAttribute(CuFormTypeEnums formTypeEnums, string[] helps, int order) {
      FormType = formTypeEnums;
      Helps = helps;
      Order = order;
   }
}
